<template>
	<div style="width: 1000px;">
		<div class="searchForm">
		    <div style="display: flex;">
		        <div>
					邀请供应商手机号/用户姓名：
				</div>
				<div>
					<selectUser ref="selectUser" @getUserId="getUserId"  />
				</div>
				<div style="margin-left: 10px;">
				    <el-button type="primary" size="mini" @click="search">检索</el-button>
				    <el-button size="mini" @click="clearSearch">重置/检索</el-button>
				</div>
		    </div>
		</div>
		<br>
		<el-table  :data="list"
			 border  
			 style="width: 100%"
			>
			 <el-table-column  label="提现供应商"   align="center">
			      <template slot-scope="scope">
			         <div>
						{{scope.row.user_info.name}}_{{scope.row.user_info.mobile}}
			 		</div>
			      </template>
			  </el-table-column>
			<el-table-column   align="center"    prop="add_time"    label="提现时间"></el-table-column>
			<el-table-column   align="center"   label="提现金额">
				<template slot-scope="scope">
				   <div>
						{{scope.row.price}}
				   </div>
				</template>
			</el-table-column>
			<el-table-column   align="center"   label="提现银行">
				<template slot-scope="scope">
				   <div>
						{{scope.row.user_bank_name}}
				   </div>
				</template>
			</el-table-column>
			<el-table-column   align="center"   label="提现账号">
				<template slot-scope="scope">
				   <div>
						{{scope.row.user_account_number}}
				   </div>
				</template>
			</el-table-column>
			<el-table-column   align="center"   label="打款状态">
				<template slot-scope="scope">
				   <div>
						<el-switch
						  @change="changeStatus(scope.row)"	
						  v-model="scope.row.status"
						 :inactive-value="'0'"
						 :active-value="'1'"
						 >
						</el-switch>
				   </div>
				</template>
			</el-table-column>
		</el-table>
		<div class="page">
		    <el-pagination
		            background
		            @size-change="pageChange"
		            @current-change="handleCurrentChange"
		            :current-page="page"
		            :page-size="pageSize"
		            layout="total, sizes, prev, pager, next, jumper"
		            :total="page_totle">
		    </el-pagination>
		</div>
	</div>
</template>

<script>
   import selectUser from '@/components/selectUser.vue';
	export default {
		components:{
			selectUser
		},
		data(){
			return {
				page:1,
				pageSize:20,
				mid:'',
				pay_price:'',
			}
		},
		mounted() {
			this.lodeList()
		},
		methods:{
			changeStatus(row){
				let params = {
					id:row.id,
					status:row.status
				}
				this.$post('/active/setWithStatus',params,res=>{
					this.lodeList()
				})
			},
			clearSearch(){
				this.mid = ''
				this.page = 1
				this.$refs['selectUser'].mid = ''
				this.$refs['selectUser'].keywords = ''
				this.lodeList()
			},
			getUserId(val){
				this.page = 1
				this.mid = val
			},
			changeReward(row){
				let params = {
					id:row.id,
					is_reward:row.is_reward
				}
				this.$post('/active/setReward',params,res=>{
					
				})
			},
			lodeList(){
				
				let params = {
					midArr:this.mid,
					page:this.page,
					pageSize:this.pageSize
				}
				this.$post('/active/withdrawList',params,res=>{
					let data = res.data.data
					this.page_totle = data.count
					this.list = data.result
				})
				
			},
		}
	}
</script>

<style>
</style>